From: Giovanni Campagna Date: Sat, 15 Dec 2012 02:24:23 +0000 (+0100) Subject: WindowManager: scale windows to their monitor's corner on minimize X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5223 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1256af7b9a6afb4f8bab82636e41e6be8ee9eb5f;p=gnome-shell.git WindowManager: scale windows to their monitor's corner on minimize We previously scaled windows to (primary.x, 0), which is wrong if the primary monitor is not at y == 0. At the same time, change the policy to pick the hot corner on the monitor the window is on, because that's closest to where it will appear in the overview. https://bugzilla.gnome.org/show_bug.cgi?id=690241 --- diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 372d9a303..60e0837ae 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -247,16 +247,17 @@ const WindowManager = new Lang.Class({ */ this._minimizing.push(actor); - let primary = Main.layoutManager.primaryMonitor; - let xDest = primary.x; + let monitor = Main.layoutManager.findMonitorForWindow(actor.meta_window); + let xDest = monitor.x; + let yDest = monitor.y; if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) - xDest += primary.width; + xDest += monitor.width; Tweener.addTween(actor, { scale_x: 0.0, scale_y: 0.0, x: xDest, - y: 0, + y: yDest, time: WINDOW_ANIMATION_TIME, transition: 'easeOutQuad', onComplete: this._minimizeWindowDone,